import request from '@/utils/request'

// 查询成品\半成品入库列表
export function listRpmMstr(query) {
  return request({
    url: '/putStorage/RpmMstr/list',
    method: 'get',
    params: query
  })
}

// 查询成品\半成品入库详细
export function getRpmMstr(rpmId) {
  return request({
    url: '/putStorage/RpmMstr/' + rpmId,
    method: 'get'
  })
}

// 获取明细数据
export function listRpd(rpdDjbh) {
  return request({
    url: '/putStorage/RpmMstr/listRpd/' + rpdDjbh,
    method: 'get'
  })
}

//获取Rpl数据
export function listRpl(rpdWldm,rpdDjbh) {
  return request({
    url: '/putStorage/RpmMstr/listRpl/' + rpdWldm +'/' + rpdDjbh,
    method: 'get'
  })
}

//获取rpd详细数据
export function getRpdDet(rpdId) {
  return request({
    url: '/putStorage/RpmMstr/getRpdDet/' + rpdId,
    method: 'get'
  })
}

//获取rpd 统计的数据
export function getRpdDetTotal(query) {
  return request({
    url: '/putStorage/RpmMstr/getRpdDetTotal',
    method: 'get',
    params: query
  })
}

// 新增成品\半成品入库
export function addRpmMstr(data) {
  return request({
    url: '/putStorage/RpmMstr',
    method: 'post',
    data: data
  })
}

// 修改成品\半成品入库
export function updateRpmMstr(data) {
  return request({
    url: '/putStorage/RpmMstr',
    method: 'put',
    data: data
  })
}

// 删除成品\半成品入库
export function delRpmMstr(rpmId) {
  return request({
    url: '/putStorage/RpmMstr/' + rpmId,
    method: 'delete'
  })
}

// 导出成品\半成品入库
export function exportRpmMstr(query) {
  return request({
    url: '/putStorage/RpmMstr/export',
    method: 'get',
    params: query
  })
}

// 查询可接收的数据
export function serachDateList(query) {
  return request({
    url: '/putStorage/RpmMstr/serachDateList',
    method: 'get',
    params: query
  })
}

//添加-保存数据
export function saveDate(data) {
  return request({
    url: '/putStorage/RpmMstr/saveDate',
    method: 'post',
    data: data
  })
}

// 删除子项数据
export function delChildren(rpdId) {
  return request({
    url: '/putStorage/RpmMstr/delChildren/' + rpdId,
    method: 'delete'
  })
}

// 单据提交
export function submitRpm(rpmId) {
  return request({
    url: '/putStorage/RpmMstr/submitRpm/' + rpmId,
    method: 'put'
  })
}

//一键检验
export function rpdAllJy(rpmDjbh) {
  return request({
    url: '/putStorage/RpmMstr/rpdAllJy/' + rpmDjbh,
    method: 'put'
  })
}

//检验结果
export function checkRpdDet(data) {
  return request({
    url: '/putStorage/RpmMstr/checkRpdDet',
    method: 'post',
    data: data
  })
}

//撤回开单
export function backOrder(data) {
  return request({
    url: '/putStorage/RpmMstr/backOrder',
    method: 'put',
    data: data
  })
}

//过账界面撤回开单
export function backLastOrder(data) {
  return request({
    url: '/putStorage/RpmMstr/backLastOrder',
    method: 'put',
    data: data
  })
}

//允收特采
export function permitSpecialRefuse(rpmId, rpmJyjg) {
  return request({
    url: '/putStorage/RpmMstr/permitSpecialRefuse/' + rpmId + '/' + rpmJyjg,
    method: 'put'
  })
}

//一键入库
export function allPutRpd(rpmDjbh) {
  return request({
    url: '/putStorage/RpmMstr/allPutRpd/' + rpmDjbh,
    method: 'put'
  })
}

/** 确认入库 */

export function rpdPost(data) {
  return request({
    url: '/putStorage/RpmMstr/rpdPost/',
    method: 'post',
    data: data
  })
}

/** 删除Rpl */
export function delRpl(id) {
  return request({
    url: '/putStorage/RpmMstr/delRpl/' + id,
    method: 'delete'
  })
}

/** 撤回检验 */
export function backCheck(rpmId, rpmDjbh) {
  return request({
    url: '/putStorage/RpmMstr/backCheck/' + rpmId + '/' + rpmDjbh,
    method: 'put'
  })
}

/** 过账 */
export function postRpm(rpmDjbh) {
  return request({
    url: '/putStorage/RpmMstr/postRpm/' + rpmDjbh,
    method: 'post'
  })
}

/** 汇总 */
export function collectRpd(data) {
  return request({
    url: '/putStorage/RpmMstr/collectRpd/',
    method: 'post',
    data: data
  })
}

/** 成品/半成品入库 统计分析 */
export function rpmReportList(query) {
  return request({
    url: '/putStorage/RpmMstr/report',
    method: 'get',
    params: query
  })
}


export function exportRpmReport(query) {
  return request({
    url: '/putStorage/RpmMstr/exportReport',
    method: 'get',
    params: query
  })
}



